<?php
defined('_JEXEC') or die;

$doc = JFactory::getDocument();

//$doc->addStyleSheet($this->baseurl . '/media/jui/css/bootstrap.min.css');
//$doc->addStyleSheet($this->baseurl . '/media/jui/css/bootstrap-responsive.css');
$doc->addStyleSheet('templates/' . $this->template . '/css/style.css');
$doc->addStyleSheet('templates/' . $this->template . '/css/custom.css');
$doc->addStyleSheet('templates/' . $this->template . '/js/js/supersized.css');
$doc->addStyleSheet('templates/' . $this->template . '/js/theme/supersized.shutter.css');

$doc->addScript('http://code.jquery.com/jquery-1.9.1.min.js', 'text/javascript');
$doc->addScript('/templates/' . $this->template . '/js/js/jquery.easing.min.js', 'text/javascript');
$doc->addScript('/templates/' . $this->template . '/js/js/supersized.3.2.7.min.js', 'text/javascript');
$doc->addScript('/templates/' . $this->template . '/js/theme/supersized.shutter.min.js', 'text/javascript');
$doc->addScript('/templates/' . $this->template . '/js/ajax_currency.js', 'text/javascript');

//define template dir
$app = JFactory::getApplication();
$templateDir = JURI::base() . 'templates/' . $app->getTemplate();
$image_slideshow = get_slide_show_images(1);
$footer_info = get_article_from_cat(13);
$footer_info = $footer_info[1];
$Item_id = Jrequest::getVar('Itemid', '', 'int');
$class_menu = 'menu_active';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <jdoc:include type="head" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">    
      <script type="text/javascript">
        jQuery(function($) {
          $.supersized({
          // Functionality
          slide_interval: 3000, // Length between transitions
                  transition: 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
                  transition_speed: 700, // Speed of transition

                  // Components							
                  slide_links: 'blank', // Individual links for each slide (Options: false, 'num', 'name', 'blank')
                  slides: [// Slideshow Images
<?php
foreach ($image_slideshow as $index => $obj) {
  $last_item = (count($image_slideshow) == ($index + 1)) ? 1 : '';
  if (!$last_item)
    $comma = ',';
  else
    $comma = '';
  ?>
            {image: '<?php JURI::base(); ?>images/phocagallery/<?php echo $obj->filename; ?>', title: '<?php echo $obj->title; ?>', thumb: '', url: ''}<?php echo $comma; ?>
<?php } ?>
          ]});
                  $(document).ready(function() {
            $(".tien").hide();
            $(".show_hide").show();
            $("#fromc").change(function() {
              var fromc = $('#fromc').val();
              var toc = $('#toc').val();
              var fromv = $('#fromv').val();
              convert_currency(fromc, toc, fromv);
            });
            $("#toc").change(function() {
              var fromc = $('#fromc').val();
              var toc = $('#toc').val();
              var fromv = $('#fromv').val();
              convert_currency(fromc, toc, fromv);
            });
            $('.show_hide').click(function() {
              $(".tien").slideToggle();
              var fromc = $('#fromc').val();
              var toc = $('#toc').val();
              var fromv = $('#fromv').val();
              convert_currency(fromc, toc, fromv);
            });
          });
          $("#fromv").keyup(function() {
            var fromc = $('#fromc').val();
            var toc = $('#toc').val();
            var fromv = $('#fromv').val();
            convert_currency(fromc, toc, fromv);
          });
          $(".show_hide").click(function() {
            $("#fromv").val('100');
            $("#tov").val('');
          })
        });
      </script>
  </head>
  <body>
    <div class="header_container">
      <div class="header">
        <div class="currency">
          <a href="#" class="show_hide">Currency Converter</a>
          <form class="tien">
            <select id="fromc" name="fromc">
              <option value="VND">VND</option>
              <option selected value="NZD">NZD</option>
              <option value="AUD">AUD</option>
              <option value="USD">USD</option>
            </select>
            <input id="fromv" maxlength="11" name="fromv" type="text" /><br />
            <select id="toc" name="toc">
              <option selected value="VND">VND</option>
              <option value="NZD">NZD</option>
              <option value="AUD">AUD</option>
              <option value="USD">USD</option>
            </select>
            <input id="tov" name="tov" type="text" />
          </form>
        </div>
        <div id="slidecaption"></div>
        <div class="logo"><a href="/"><img src="<?php echo $templateDir; ?>/images/spj_logo_02.png" width="319" height="141" alt="South Pacific Journeys" /></a></div>
        <div class="menu">
          <ul>
            <li><a class="<?php if ($Item_id == '143') echo $class_menu; ?>" href="<?php echo JRoute::_('index.php?option=com_general&view=about&Itemid=143') ?>">About SPJ</a></li>
            <li><a class="<?php if ($Item_id == '137') echo $class_menu; ?>"  href="<?php echo JRoute::_('index.php?option=com_tours&view=tours&Itemid=137') ?>">Tour</a></li>
            <li><a class="<?php if ($Item_id == '144') echo $class_menu; ?>" href="<?php echo JRoute::_('index.php?option=com_general&view=handbook&Itemid=144') ?>">Handbook</a></li>
            <li><a class="<?php if ($Item_id == '140') echo $class_menu; ?>" href="<?php echo JRoute::_('index.php?option=com_general&view=careers&Itemid=140') ?>">Careers</a></li>
            <li><a class="<?php if ($Item_id == '141') echo $class_menu; ?>" href="<?php echo JRoute::_('index.php?option=com_general&view=contact&Itemid=141') ?>">Contact</a></li>
          </ul></div>
        <div class="social"><a href="#"><img src="<?php echo $templateDir; ?>/images/header_icons_05.gif" alt="Sitemap" width="30" height="21" hspace="10" border="0" /></a><a href="#"><img src="<?php echo $templateDir; ?>/images/header_icons_07.gif" alt="Facebook" width="22" height="21" border="0" /></a></div>
      </div>
    </div>
    <jdoc:include type="message" />
    <jdoc:include type="component" />
    <div class="footer_container">
      <div class="footer">
        <div class="footer_left"> 
          <?php echo $footer_info->introtext; ?>
        </div>
        <div class="footer_right">
          <ul>
            <li><a class="<?php if ($Item_id == '143') echo $class_menu; ?>" href="<?php echo JRoute::_('index.php?option=com_general&view=about&Itemid=143') ?>">About SPJ</a></li>
            <li><a class="<?php if ($Item_id == '137') echo $class_menu; ?>" href="<?php echo JRoute::_('index.php?option=com_tours&view=tours&Itemid=137') ?>">Tour</a></li>
            <li><a class="<?php if ($Item_id == '144') echo $class_menu; ?>" href="<?php echo JRoute::_('index.php?option=com_general&view=handbook&Itemid=144') ?>">Handbook</a></li>
            <li><a class="<?php if ($Item_id == '140') echo $class_menu; ?>" href="<?php echo JRoute::_('index.php?option=com_general&view=careers&Itemid=140') ?>">Careers</a></li>
            <li><a class="<?php if ($Item_id == '141') echo $class_menu; ?>" href="<?php echo JRoute::_('index.php?option=com_general&view=contact&Itemid=141') ?>">Contact</a></li>
            <li><a href="#">Sitemap</a></li>
          </ul>
          <div class="footer_social"><a href="#"><img src="<?php echo $templateDir; ?>/images/spj_social_icon_06.gif" width="32" height="32" /></a><a href="#"><img src="<?php echo $templateDir; ?>/images/spj_social_icon_08.gif" width="32" height="32" /></a><a href="#"><img src="<?php echo $templateDir; ?>/images/spj_social_icon_10.gif" width="32" height="32" /></a><a href="#"><img src="<?php echo $templateDir; ?>/images/spj_social_icon_12.gif" width="32" height="32" /></a></div>
          <strong>Copyright by South Pacific Journeys Ltd. All Rights Reserved</strong>

        </div>
        <br class="clear" />
      </div>
    </div>
  </body>
</html>
